var axios = require("axios");

module.exports = {
    namespaced: true,
    state: {
        shop: {
            shopList: []
        }
    },
    mutations: {
        getApplicationShop(state, data) {
            state.shop.shopList = [...data];
        }
    },
    actions: {
        getApplicationShopAsync(context) {
            axios.get("/shop/getApplicationShop").then(({ data }) => {
                console.log(data)
                context.commit("getApplicationShop", data);
            })
        },
        agreeAndRefuseAsync(context, data) {
            console.log(data)
            axios.post("/shop/agreeAndRefuse", { _id: data._id, bool: data.bool }).then(({ data }) => {
                console.log(data)
            })
        }
    },
}